import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";
import _toSafeInteger from "lodash/toSafeInteger";
import _isEmpty from "lodash/isEmpty";
import _uniqBy from "lodash/uniqBy";

var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _class, _class2;

import React from 'react';
import { Drawer, Form, Icon, Input, InputNumber, Select, Button, Tag } from 'antd';
import { Bind } from 'lodash-decorators';
import uuidv4 from 'uuid/v4';
import TLEditor from 'components/TLEditor';
import EditTable from 'components/EditTable';
import { Button as ButtonPermission } from 'components/Permission';
import intl from 'utils/intl';
import { tableScrollWidth } from 'utils/utils';
import { enableRender, operatorRender } from 'utils/renderer';
import { CODE_LOWER } from 'utils/regExp';
import Permissions from "../Permissions";
import Lovs from "../Lovs";
import QueryForm from "./QueryForm";
import styles from "./index.less?modules";
var PermissionSet = (_dec = Form.create({
  fieldNameProp: null
}), _dec2 = Bind(), _dec3 = Bind(), _dec4 = Bind(), _dec5 = Bind(), _dec6 = Bind(), _dec7 = Bind(), _dec8 = Bind(), _dec9 = Bind(), _dec10 = Bind(), _dec11 = Bind(), _dec12 = Bind(), _dec13 = Bind(), _dec(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
  _inherits(PermissionSet, _React$Component);

  var _super = _createSuper(PermissionSet);

  function PermissionSet() {
    var _this;

    _classCallCheck(this, PermissionSet);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));
    _this.state = {
      tableDataSource: [],
      currentRowData: {},
      permissionsDrawerVisible: false,
      editingRows: [],
      processingRowKeys: [],
      lovsDrawerVisible: false
    };
    return _this;
  }

  _createClass(PermissionSet, [{
    key: "getSnapshotBeforeUpdate",
    value: function getSnapshotBeforeUpdate(prevProps) {
      var _this$props = this.props,
          visible = _this$props.visible,
          menuDataSource = _this$props.menuDataSource;
      return visible && menuDataSource.id !== undefined && menuDataSource.id !== prevProps.menuDataSource.id;
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps, prevState, snapshot) {
      // If we have a snapshot value, we've just added new items.
      // Adjust scroll so these new items don't push the old ones out of view.
      // (snapshot here is the value returned from getSnapshotBeforeUpdate)
      if (snapshot) {
        this.fetchDataSource();
      }
    }
  }, {
    key: "fetchDataSource",
    value: function fetchDataSource(params) {
      var _this2 = this;

      var _this$props2 = this.props,
          _this$props2$handleQu = _this$props2.handleQueryList,
          handleQueryList = _this$props2$handleQu === void 0 ? function (e) {
        return e;
      } : _this$props2$handleQu,
          _this$props2$menuData = _this$props2.menuDataSource,
          menuDataSource = _this$props2$menuData === void 0 ? {} : _this$props2$menuData;
      handleQueryList(menuDataSource.id, params).then(function (res) {
        var dataSource = res.dataSource;

        _this2.setState({
          tableDataSource: dataSource
        });
      });
    }
  }, {
    key: "onDrawerClose",
    value: function onDrawerClose() {
      var _this$props$close = this.props.close,
          close = _this$props$close === void 0 ? function (e) {
        return e;
      } : _this$props$close;
      this.setState({
        tableDataSource: [],
        currentRowData: {},
        editingRows: []
      });
      close();
    }
  }, {
    key: "save",
    value: function save(record, form) {
      var _this3 = this;

      var _this$props3 = this.props,
          _this$props3$handleSa = _this$props3.handleSave,
          handleSave = _this$props3$handleSa === void 0 ? function (e) {
        return e;
      } : _this$props3$handleSa,
          _this$props3$handleCr = _this$props3.handleCreate,
          handleCreate = _this$props3$handleCr === void 0 ? function (e) {
        return e;
      } : _this$props3$handleCr,
          _this$props3$menuData = _this$props3.menuDataSource,
          menuDataSource = _this$props3$menuData === void 0 ? {} : _this$props3$menuData;
      var _this$state$processin = this.state.processingRowKeys,
          processingRowKeys = _this$state$processin === void 0 ? [] : _this$state$processin;
      var _form$validateFields = form.validateFields,
          validateFields = _form$validateFields === void 0 ? function (e) {
        return e;
      } : _form$validateFields;
      var defaultCode = menuDataSource.code;
      var codePrefix = "".concat(defaultCode, ".ps.");
      validateFields(function (err, values) {
        if (_isEmpty(err)) {
          var newRecord = _objectSpread(_objectSpread(_objectSpread({}, record), values), {}, {
            icon: 'link'
          });

          _this3.setState({
            processingRowKeys: _uniqBy(processingRowKeys.concat(record.key))
          });

          if (record._status === 'create') {
            newRecord.code = "".concat(codePrefix).concat(values.code);
            handleCreate(newRecord, function () {
              _this3.fetchDataSource(); // this.cancel(record);


              _this3.setState({
                processingRowKeys: processingRowKeys.filter(function (o) {
                  return o !== record.key;
                })
              });
            });
          } else {
            handleSave(newRecord, function () {
              _this3.fetchDataSource();

              _this3.cancel(record);

              _this3.setState({
                processingRowKeys: processingRowKeys.filter(function (o) {
                  return o !== record.key;
                })
              });
            });
          }
        } else {
          setTimeout(function () {
            _this3.forceUpdate();
          }, 23);
        }
      });
    }
  }, {
    key: "operationRender",
    value: function operationRender(text, record) {
      var _this4 = this;

      var _this$props4 = this.props,
          _this$props4$handleEn = _this$props4.handleEnable,
          handleEnable = _this$props4$handleEn === void 0 ? function (e) {
        return e;
      } : _this$props4$handleEn,
          _this$props4$processi = _this$props4.processing,
          processing = _this$props4$processi === void 0 ? {} : _this$props4$processi,
          path = _this$props4.path;
      var _this$state$processin2 = this.state.processingRowKeys,
          processingRowKeys = _this$state$processin2 === void 0 ? [] : _this$state$processin2;
      var operators = [];

      if (record._status === 'create' || record._status === 'update') {
        if ((processing.save || processing.create) && !_isEmpty(processingRowKeys.filter(function (o) {
          return o === record.key;
        }))) {
          operators = [{
            key: 'loading',
            ele: /*#__PURE__*/React.createElement(Icon, {
              type: "loading"
            }),
            len: 2
          }];
        } else {
          operators = [{
            key: 'save',
            ele: /*#__PURE__*/React.createElement("a", {
              onClick: function onClick() {
                return _this4.save(record, record.$form);
              }
            }, intl.get('cpaas.common.button.save').d('保存')),
            len: 2,
            title: intl.get('cpaas.common.button.save').d('保存')
          }, {
            key: 'cancel',
            ele: /*#__PURE__*/React.createElement("a", {
              onClick: function onClick() {
                return _this4.cancel(record);
              }
            }, intl.get('cpaas.common.button.cancel').d('取消')),
            len: 2,
            title: intl.get('cpaas.common.button.cancel').d('取消')
          }];
        }
      } else {
        operators = [{
          key: 'edit',
          ele: /*#__PURE__*/React.createElement(ButtonPermission, {
            type: "text",
            permissionList: [{
              code: "".concat(path, ".button.editPermissionSet"),
              type: 'button',
              meaning: '菜单配置-权限集编辑'
            }],
            onClick: function onClick() {
              return _this4.edit(record);
            }
          }, intl.get('cpaas.common.button.edit').d('编辑')),
          len: 2,
          title: intl.get('cpaas.common.button.edit').d('编辑')
        }, {
          key: 'able',
          ele: record.enabledFlag === 1 ? /*#__PURE__*/React.createElement(ButtonPermission, {
            type: "text",
            permissionList: [{
              code: "".concat(path, ".button.disablePermissionSet"),
              type: 'button',
              meaning: '菜单配置-权限集禁用'
            }],
            onClick: function onClick() {
              return handleEnable(record, 'disable', _this4.fetchDataSource);
            }
          }, intl.get('cpaas.common.status.disable').d('禁用')) : /*#__PURE__*/React.createElement(ButtonPermission, {
            type: "text",
            permissionList: [{
              code: "".concat(path, ".button.enablePermissionSet"),
              type: 'button',
              meaning: '菜单配置-权限集启用'
            }],
            onClick: function onClick() {
              return handleEnable(record, 'enable', _this4.fetchDataSource);
            }
          }, intl.get('cpaas.common.status.enable').d('启用')),
          len: 2,
          title: record.enabledFlag === 1 ? intl.get('cpaas.common.status.disable').d('禁用') : intl.get('cpaas.common.status.enable').d('启用')
        }, {
          key: 'permissions',
          ele: /*#__PURE__*/React.createElement("a", {
            onClick: function onClick() {
              return _this4.openPermissionsDrawer(record, record.editDetailFlag === 1);
            }
          }, intl.get('ciam.menuConfig.view.message.title.permissions').d('权限')),
          len: 2,
          title: intl.get('ciam.menuConfig.view.message.title.permissions').d('权限')
        }, {
          key: 'lov',
          ele: /*#__PURE__*/React.createElement("a", {
            onClick: function onClick() {
              return _this4.openLovsDrawer(record, record.editDetailFlag === 1);
            }
          }, intl.get('ciam.menuConfig.view.message.title.lovs').d('Lov')),
          len: 3,
          title: intl.get('ciam.menuConfig.view.message.title.lovs').d('Lov')
        }];
      }

      return operatorRender(operators, record, {
        limit: 5
      });
    }
  }, {
    key: "openPermissionsDrawer",
    value: function openPermissionsDrawer(currentRowData) {
      this.setState({
        currentRowData: currentRowData,
        permissionsDrawerVisible: true
      });
    }
  }, {
    key: "closePermissionsDrawer",
    value: function closePermissionsDrawer() {
      this.setState({
        currentRowData: {},
        permissionsDrawerVisible: false
      });
    }
  }, {
    key: "openLovsDrawer",
    value: function openLovsDrawer(currentRowData) {
      this.setState({
        currentRowData: currentRowData,
        lovsDrawerVisible: true
      });
    }
  }, {
    key: "closeLovsDrawer",
    value: function closeLovsDrawer() {
      this.setState({
        currentRowData: {},
        lovsDrawerVisible: false
      });
    }
  }, {
    key: "add",
    value: function add() {
      var _this$props$menuDataS = this.props.menuDataSource,
          menuDataSource = _this$props$menuDataS === void 0 ? {} : _this$props$menuDataS;
      var _this$state = this.state,
          _this$state$tableData = _this$state.tableDataSource,
          tableDataSource = _this$state$tableData === void 0 ? [] : _this$state$tableData,
          editingRows = _this$state.editingRows;
      var item = {
        _status: 'create',
        key: uuidv4(),
        type: 'ps',
        level: menuDataSource.level,
        enabledFlag: 1,
        newSubnodeFlag: 1,
        editDetailFlag: 1,
        parentId: menuDataSource.id
      };
      this.setState({
        editingRows: _uniqBy(editingRows.concat(item), 'key'),
        tableDataSource: [item].concat(tableDataSource)
      });
    }
  }, {
    key: "edit",
    value: function edit(record) {
      var _this$state$tableData2 = this.state.tableDataSource,
          tableDataSource = _this$state$tableData2 === void 0 ? [] : _this$state$tableData2;
      this.setState({
        tableDataSource: tableDataSource.map(function (rd) {
          if (rd.key === record.key) {
            return _objectSpread(_objectSpread({}, rd), {}, {
              _status: 'update'
            });
          } else {
            return rd;
          }
        })
      });
    }
  }, {
    key: "cancel",
    value: function cancel(record) {
      var _this$state2 = this.state,
          tableDataSource = _this$state2.tableDataSource,
          editingRows = _this$state2.editingRows;
      this.setState({
        tableDataSource: record._status !== 'create' ? tableDataSource.map(function (rd) {
          if (rd.key === record.key) {
            return _objectSpread(_objectSpread({}, rd), {}, {
              _status: ''
            });
          } else {
            return rd;
          }
        }) : tableDataSource.filter(function (rd) {
          return rd.key !== record.key;
        }),
        editingRows: editingRows.filter(function (o) {
          return o.key !== record.key;
        })
      });
    }
  }, {
    key: "getColumns",
    value: function getColumns() {
      var _this$props$controlle = this.props.controllerType,
          controllerType = _this$props$controlle === void 0 ? [] : _this$props$controlle;
      var defaultColumns = [{
        title: intl.get('ciam.menuConfig.model.menuConfig.permissionSetCode').d('权限集编码'),
        dataIndex: 'code',
        width: 300,
        render: function render(val, record) {
          if (record._status === 'create') {
            var getFieldDecorator = record.$form.getFieldDecorator;
            return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('code', {
              initialValue: record.code,
              rules: [{
                required: true,
                message: intl.get('cpaas.common.validation.notNull', {
                  name: intl.get('ciam.menuConfig.model.menuConfig.permissionSetCode').d('权限集编码')
                })
              }, {
                pattern: CODE_LOWER,
                message: intl.get('cpaas.common.validation.codeLower').d('全小写及数字，必须以字母、数字开头，可包含“-”、“_”、“.”、“/”')
              }, {
                max: 128,
                message: intl.get('cpaas.common.validation.max', {
                  max: 128
                })
              }]
            })( /*#__PURE__*/React.createElement(Input, {
              trim: true,
              style: {
                width: 200
              },
              typeCase: "lower",
              inputChinese: false,
              disabled: record._status !== 'create'
            })));
          } else {
            return val;
          }
        }
      }, {
        title: intl.get('ciam.menuConfig.model.menuConfig.permissionSetName').d('权限集名称'),
        dataIndex: 'name',
        width: 160,
        render: function render(val, record) {
          var _token = record._token;

          if (record._status === 'update' || record._status === 'create') {
            var getFieldDecorator = record.$form.getFieldDecorator;
            return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('name', {
              initialValue: record.name,
              rules: [{
                required: true,
                message: intl.get('cpaas.common.validation.notNull', {
                  name: intl.get('ciam.menuConfig.model.menuConfig.permissionSetName').d('权限集名称')
                })
              }, {
                max: 128,
                message: intl.get('cpaas.common.validation.max', {
                  max: 128
                })
              }]
            })( /*#__PURE__*/React.createElement(TLEditor, {
              field: "name",
              token: _token
            })));
          } else {
            return val;
          }
        }
      }, {
        title: intl.get('ciam.menuConfig.model.menuConfig.sort').d('序号'),
        dataIndex: 'sort',
        width: 80,
        render: function render(val, record) {
          if (record._status === 'update' || record._status === 'create') {
            var getFieldDecorator = record.$form.getFieldDecorator;
            return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('sort', {
              initialValue: record.sort
            })( /*#__PURE__*/React.createElement(InputNumber, {
              style: {
                width: 70
              },
              min: 0,
              step: 1,
              parser: _toSafeInteger
            })));
          } else {
            return val;
          }
        }
      }, {
        dataIndex: 'permissionType',
        title: intl.get('ciam.menuConfig.model.menuConfig.permissionType').d('权限类型'),
        width: 150,
        render: function render() {
          var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
          var texts = {
            api: intl.get('ciam.roleManagement.view.message.api').d('API'),
            button: intl.get('ciam.roleManagement.view.message.button').d('按钮'),
            table: intl.get('ciam.roleManagement.view.message.table').d('表格列'),
            formItem: intl.get('ciam.roleManagement.view.message.formItem').d('表单项'),
            formField: intl.get('ciam.roleManagement.view.message.formField').d('表单域')
          };
          var valueList = value.split(',') || [];
          var text = valueList.map(function (item) {
            return texts[item] ? texts[item] : '';
          }) || [];
          return value === undefined || value === '' ? null : /*#__PURE__*/React.createElement(Tag, {
            color: value === 'api' ? 'green' : 'orange'
          }, text.join());
        }
      }, {
        title: intl.get('ciam.menuConfig.model.menuConfig.controllerTypeMeaning').d('权限集控制类型'),
        width: 120,
        dataIndex: 'controllerTypeMeaning',
        render: function render(val, record) {
          if ((record._status === 'update' || record._status === 'create') && record.permissionType !== 'api') {
            var getFieldDecorator = record.$form.getFieldDecorator;
            return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('controllerType', {
              initialValue: record.controllerType
            })( /*#__PURE__*/React.createElement(Select, {
              style: {
                width: '100%'
              },
              allowClear: true
            }, controllerType.map(function (item) {
              return /*#__PURE__*/React.createElement(Select.Option, {
                value: item.value,
                key: item.value
              }, item.meaning);
            }))));
          } else {
            return val;
          }
        }
      }, {
        title: intl.get('ciam.menuConfig.model.menuConfig.description').d('描述'),
        dataIndex: 'description',
        render: function render(val, record) {
          if (record._status === 'update' || record._status === 'create') {
            var getFieldDecorator = record.$form.getFieldDecorator;
            return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('description', {
              initialValue: record.description
            })( /*#__PURE__*/React.createElement(Input, null)));
          } else {
            return val;
          }
        }
      }, {
        title: intl.get('cpaas.common.status').d('状态'),
        dataIndex: 'enabledFlag',
        render: enableRender,
        width: 80
      }, {
        title: intl.get('cpaas.common.table.column.option').d('操作'),
        width: 260,
        fixed: 'right',
        render: this.operationRender
      }];
      return defaultColumns;
    }
  }, {
    key: "onPermissionsDrawerOk",
    value: function onPermissionsDrawerOk(key, permissions, keyPath) {
      var tableDataSource = this.state.tableDataSource;

      var getTableDataSource = function getTableDataSource() {
        var collections = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        return collections.map(function (n) {
          var m = n;
          m.permissions = m.key === key ? permissions : m.permissions;
          return m;
        });
      };

      this.setState({
        tableDataSource: getTableDataSource(tableDataSource, keyPath)
      });
    }
  }, {
    key: "savePermissions",
    value: function savePermissions(key, permissions) {
      var _this5 = this;

      var keyPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
      var cb = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (e) {
        return e;
      };
      var _this$props$handleSav = this.props.handleSave,
          handleSave = _this$props$handleSav === void 0 ? function (e) {
        return e;
      } : _this$props$handleSav;
      var tableDataSource = this.state.tableDataSource;
      var newRecord = {};

      var findDeep = function findDeep() {
        var collections = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
        return collections.forEach(function (n) {
          var m = n;

          if (m.key === key) {
            newRecord = m;
          }
        });
      };

      findDeep(tableDataSource, keyPath);
      newRecord.permissions = permissions;
      handleSave(newRecord, function () {
        _this5.fetchDataSource();

        cb();
      });
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props5 = this.props,
          currentRoleCode = _this$props5.currentRoleCode,
          visible = _this$props5.visible,
          path = _this$props5.path,
          _this$props5$processi = _this$props5.processing,
          processing = _this$props5$processi === void 0 ? {} : _this$props5$processi,
          _this$props5$menuData = _this$props5.menuDataSource,
          menuDataSource = _this$props5$menuData === void 0 ? {} : _this$props5$menuData,
          _this$props5$handleQu = _this$props5.handleQueryPermissions,
          handleQueryPermissions = _this$props5$handleQu === void 0 ? function (e) {
        return e;
      } : _this$props5$handleQu,
          _this$props5$handleQu2 = _this$props5.handleQueryPermissionsBySet,
          handleQueryPermissionsBySet = _this$props5$handleQu2 === void 0 ? function (e) {
        return e;
      } : _this$props5$handleQu2,
          _this$props5$handleQu3 = _this$props5.handleQueryLovsBySet,
          handleQueryLovsBySet = _this$props5$handleQu3 === void 0 ? function (e) {
        return e;
      } : _this$props5$handleQu3,
          _this$props5$handleQu4 = _this$props5.handleQueryLovs,
          handleQueryLovs = _this$props5$handleQu4 === void 0 ? function (e) {
        return e;
      } : _this$props5$handleQu4,
          _this$props5$onAssign = _this$props5.onAssignPermissions,
          onAssignPermissions = _this$props5$onAssign === void 0 ? function (e) {
        return e;
      } : _this$props5$onAssign,
          _this$props5$onDelete = _this$props5.onDeletePermissions,
          onDeletePermissions = _this$props5$onDelete === void 0 ? function (e) {
        return e;
      } : _this$props5$onDelete;
      var _this$state3 = this.state,
          tableDataSource = _this$state3.tableDataSource,
          permissionsDrawerVisible = _this$state3.permissionsDrawerVisible,
          currentRowData = _this$state3.currentRowData,
          lovsDrawerVisible = _this$state3.lovsDrawerVisible;
      var drawerProps = {
        title: intl.get('ciam.menuConfig.view.message.title.permissionName', {
          name: menuDataSource.name
        }).d("\"".concat(menuDataSource.name, "\"\u7684\u6743\u9650\u96C6")),
        visible: visible,
        mask: true,
        maskStyle: {
          backgroundColor: 'rgba(0,0,0,.85)'
        },
        placement: 'right',
        destroyOnClose: true,
        onClose: this.onDrawerClose,
        width: 980,
        wrapClassName: styles['ciam-menu-config-permission-set']
      };
      var columns = this.getColumns();
      var tableProps = {
        rowKey: 'key',
        dataSource: tableDataSource,
        columns: columns,
        scroll: {
          x: tableScrollWidth(columns)
        },
        pagination: false,
        bordered: true,
        loading: processing.query || processing.setPermissionLoading
      };
      var permissionsDrawerProps = {
        path: path,
        currentRoleCode: currentRoleCode,
        handleQueryPermissions: handleQueryPermissions,
        // 查询可分配的权限
        handleQueryPermissionsBySet: handleQueryPermissionsBySet,
        // 查询已分配的权限
        onAssignPermissions: onAssignPermissions,
        onDeletePermissions: onDeletePermissions,
        processing: processing,
        visible: permissionsDrawerVisible,
        permissionSetDataSource: currentRowData,
        close: this.closePermissionsDrawer,
        menuId: menuDataSource.id,
        title: intl.get('ciam.menuConfig.view.message.title.viewPermissions', {
          name: currentRowData.name
        }).d("\u201C".concat(currentRowData.name, "\u201D\u7684\u6743\u9650")),
        editable: currentRowData.editDetailFlag === 1
      };
      var lovsDrawerProps = {
        path: path,
        currentRoleCode: currentRoleCode,
        handleQueryLovs: handleQueryLovs,
        // 查询可分配的Lov
        handleQueryLovsBySet: handleQueryLovsBySet,
        // 查询已分配的Lov
        onAssignPermissions: onAssignPermissions,
        onDeletePermissions: onDeletePermissions,
        processing: processing,
        visible: lovsDrawerVisible,
        permissionSetDataSource: currentRowData,
        close: this.closeLovsDrawer,
        menuId: menuDataSource.id,
        title: intl.get('ciam.menuConfig.view.message.title.viewLovs', {
          name: currentRowData.name
        }).d("\u201C".concat(currentRowData.name, "\u201D\u7684Lov")),
        editable: currentRowData.editDetailFlag === 1
      };
      return /*#__PURE__*/React.createElement(Drawer, drawerProps, /*#__PURE__*/React.createElement(QueryForm, {
        handleQueryList: this.fetchDataSource
      }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", {
        style: {
          display: 'flex',
          justifyContent: 'flex-end'
        }
      }, /*#__PURE__*/React.createElement(Button, {
        style: {
          marginRight: 8
        },
        onClick: this.collapseAll
      }, intl.get('cpaas.common.button.collapseAll').d('全部收起')), /*#__PURE__*/React.createElement(Button, {
        onClick: this.expandAll
      }, intl.get('cpaas.common.button.expandAll').d('全部展开')), /*#__PURE__*/React.createElement(ButtonPermission, {
        permissionList: [{
          code: "".concat(path, ".button.createPermissionSet"),
          type: 'button',
          meaning: '菜单配置-新建权限集'
        }],
        style: {
          marginLeft: 8
        },
        onClick: this.add
      }, intl.get('cpaas.common.button.create').d('新建'))), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(EditTable, tableProps), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", {
        className: "footer"
      }, /*#__PURE__*/React.createElement(Button, {
        onClick: this.onDrawerClose,
        type: "primary"
      }, intl.get('cpaas.common.button.close').d('关闭'))), permissionsDrawerVisible && /*#__PURE__*/React.createElement(Permissions, permissionsDrawerProps), lovsDrawerVisible && /*#__PURE__*/React.createElement(Lovs, lovsDrawerProps));
    }
  }]);

  return PermissionSet;
}(React.Component), (_applyDecoratedDescriptor(_class2.prototype, "fetchDataSource", [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, "fetchDataSource"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "onDrawerClose", [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, "onDrawerClose"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "save", [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, "save"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "operationRender", [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, "operationRender"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "openPermissionsDrawer", [_dec6], Object.getOwnPropertyDescriptor(_class2.prototype, "openPermissionsDrawer"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "closePermissionsDrawer", [_dec7], Object.getOwnPropertyDescriptor(_class2.prototype, "closePermissionsDrawer"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "openLovsDrawer", [_dec8], Object.getOwnPropertyDescriptor(_class2.prototype, "openLovsDrawer"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "closeLovsDrawer", [_dec9], Object.getOwnPropertyDescriptor(_class2.prototype, "closeLovsDrawer"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "add", [_dec10], Object.getOwnPropertyDescriptor(_class2.prototype, "add"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "edit", [_dec11], Object.getOwnPropertyDescriptor(_class2.prototype, "edit"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "cancel", [_dec12], Object.getOwnPropertyDescriptor(_class2.prototype, "cancel"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "getColumns", [_dec13], Object.getOwnPropertyDescriptor(_class2.prototype, "getColumns"), _class2.prototype)), _class2)) || _class);
export { PermissionSet as default };